package org.grow.took.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


//统一异常处理 aop
//    能够捕获controller里的异常 包括service dao
//    但是对filter 无效
@RestControllerAdvice
public class ExceptionBridge {

    @ExceptionHandler(SeptemberException.class)
    public ResponseEntity<String> sepEx(SeptemberException e){
        return  new ResponseEntity<String>(e.getMessage(),
                null,e.getCode());
    }

}
